const getBMap = () => {
  let intervalID = null;
  return new Promise((resolve) => {
    if (window.BMap) {
      resolve(window.BMap);
    } else {
      intervalID = setInterval(() => {
        if (window.BMap) {
          clearInterval(intervalID);
          resolve(window.BMap);
        }
      }, 200);
    }
  });
};

export default {
  getBMap
};
